package com.marchsoft.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;


import com.marchsoft.util.RequestToJson;

import myException.CustomException;

@ControllerAdvice
public class GlobalExceptionHandler {
	
	@ExceptionHandler(value=CustomException.class)
	@ResponseBody
	public RequestToJson aa(HttpServletRequest request, CustomException e) {
		return new RequestToJson(2, e.getMessage(), null);
	}
}
